package com.nts.visionworks.business.endpoint.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * BuildingFloorArea generated by hbm2java
 */
@Entity
@Table(name = "building_floor_area", catalog = "visionworks")
public class BuildingFloorArea implements java.io.Serializable
{

	private Integer areaId;
	private BuildingFloor buildingFloor;
	private String areaName;
	private Long areaImageArchiveId;
	private Set<EndPoint> endPoints = new HashSet<EndPoint>(0);

	public BuildingFloorArea()
	{
	}

	public BuildingFloorArea(BuildingFloor buildingFloor, String areaName)
	{
		this.buildingFloor = buildingFloor;
		this.areaName = areaName;
	}

	public BuildingFloorArea(BuildingFloor buildingFloor, String areaName,
			Long areaImageArchiveId, Set<EndPoint> endPoints)
	{
		this.buildingFloor = buildingFloor;
		this.areaName = areaName;
		this.areaImageArchiveId = areaImageArchiveId;
		this.endPoints = endPoints;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "AreaId", unique = true, nullable = false)
	public Integer getAreaId()
	{
		return this.areaId;
	}

	public void setAreaId(Integer areaId)
	{
		this.areaId = areaId;
	}

	@EntityIdNotNull(message = "validation.endPoint.buildingFloorArea.buildingFloor.notNull")
	@JsonIgnore
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FloorId", nullable = false)
	public BuildingFloor getBuildingFloor()
	{
		return this.buildingFloor;
	}

	public void setBuildingFloor(BuildingFloor buildingFloor)
	{
		this.buildingFloor = buildingFloor;
	}

	@NotNull(message = "validation.endPoint.buildingFloorArea.areaName.notNull")
	@Size(message = "validation.endPoint.buildingFloorArea.areaName.length", min = 1, max = 200)
	@Column(name = "AreaName", nullable = false, length = 200)
	public String getAreaName()
	{
		return this.areaName;
	}

	public void setAreaName(String areaName)
	{
		this.areaName = areaName;
	}

	@Column(name = "AreaImageArchiveId")
	public Long getAreaImageArchiveId()
	{
		return this.areaImageArchiveId;
	}

	public void setAreaImageArchiveId(Long areaImageArchiveId)
	{
		this.areaImageArchiveId = areaImageArchiveId;
	}

	@JsonIgnore
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "buildingFloorArea")
	public Set<EndPoint> getEndPoints()
	{
		return this.endPoints;
	}

	public void setEndPoints(Set<EndPoint> endPoints)
	{
		this.endPoints = endPoints;
	}

}
